package com.example.task.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author void
 * @date 2020/6/16 22:30
 * @desc
 */
@Slf4j
@Component
public class ScheduleTask2 {

//    @Scheduled(fixedDelay = 5000)
    public void test1(){
        log.info("ScheduleTask2.test1");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

//    @Scheduled(fixedDelay = 5000)
    public void test2(){
        log.info("ScheduleTask2.test2");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

//    @Scheduled(cron = "0/1 * * * * ?")
    public void test3(){
        log.info("ScheduleTask2.test3");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
